{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h2><i class="fas fa-home"></i> 收容所信息</h2>
    <a href="{% url 'home' %}" class="btn btn-outline-primary mb-3">
        <i class="fas fa-arrow-left"></i> 返回首页
    </a>
    
    <table class="table table-striped table-bordered">
        <thead class="thead-dark">
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>城市</th>
                <th>地址</th>
            </tr>
        </thead>
        <tbody>
            {% for site in sites %}
            <tr>
                <td>{{ site.siteid }}</td>
                <td>{{ site.sname }}</td>
                <td>{{ site.sarea}}</td>
                <td>{{ site.address }}</td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="4" class="text-center">暂无收容所信息</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}